<?php

namespace catchAdmin\phone\model;

class News extends \catchAdmin\model\News
{

    ######################################## 显示 ################################################

    public function indexData($param)
    {
        $app = $this
            ->order('sort desc');

        return $this->indexDataCC($param, $app);
    }


    public function indexBanner()
    {
        return $this
            ->where('banner_is', 2)
            ->order('sort desc')
            ->select();
    }


    /**
     * 已读
     */
    public function read($param)
    {
        $msg = $this
            ->where('id', $param['id'])
            ->find();

        $msg->view_count += 1;
        $msg->save();

        return $msg;
    }

}
